s={10,20,30,40}
print(s)
# 集合只能储存不可变数据类型
s={}
print(s,type(s))
s=set()
print(s,type(s))

s=set("helloworld") #无序不重复
print(s)

s=([10,20,30])
print(s)

s=set(range(1,10))
print(s)
print("max: ",max(s))
print("len: ",len(s))
print("9在集合s中嘛",(9 in s))

del s

a={10,20,30,40,50}
b={30,50,88,33,56}
print(a&b)
print(a|b)
print(a-b)
print(a^b)

s={10,20,30}
s.add(100)
print(s)
s.remove(20)
print(s)
#s.clear()
#print(s)

for i in s:
    print(s)

for i,j in enumerate(s):
    print(i,"-->",j)

s={ i for i in range(1,10) if i%2==0}
print(s)

